package com.ruoyi.dispatch.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dispatch.mapper.WorkfaceInfoMapper;
import com.ruoyi.dispatch.domain.WorkfaceInfo;
import com.ruoyi.dispatch.service.IWorkfaceInfoService;

/**
 * 工作面信息Service业务层处理
 * 
 * @author wuxiaofang
 * @date 2025-04-03
 */
@Service
public class WorkfaceInfoServiceImpl implements IWorkfaceInfoService 
{
    @Autowired
    private WorkfaceInfoMapper workfaceInfoMapper;

    /**
     * 查询工作面信息
     * 
     * @param workfaceId 工作面信息主键
     * @return 工作面信息
     */
    @Override
    public WorkfaceInfo selectWorkfaceInfoByWorkfaceId(Long workfaceId)
    {
        return workfaceInfoMapper.selectWorkfaceInfoByWorkfaceId(workfaceId);
    }

    /**
     * 查询工作面信息列表
     * 
     * @param workfaceInfo 工作面信息
     * @return 工作面信息
     */
    @Override
    public List<WorkfaceInfo> selectWorkfaceInfoList(WorkfaceInfo workfaceInfo)
    {
        return workfaceInfoMapper.selectWorkfaceInfoList(workfaceInfo);
    }

    /**
     * 新增工作面信息
     * 
     * @param workfaceInfo 工作面信息
     * @return 结果
     */
    @Override
    public int insertWorkfaceInfo(WorkfaceInfo workfaceInfo)
    {
        workfaceInfo.setCreateTime(DateUtils.getNowDate());
        return workfaceInfoMapper.insertWorkfaceInfo(workfaceInfo);
    }

    /**
     * 修改工作面信息
     * 
     * @param workfaceInfo 工作面信息
     * @return 结果
     */
    @Override
    public int updateWorkfaceInfo(WorkfaceInfo workfaceInfo)
    {
        workfaceInfo.setUpdateTime(DateUtils.getNowDate());
        return workfaceInfoMapper.updateWorkfaceInfo(workfaceInfo);
    }

    /**
     * 批量删除工作面信息
     * 
     * @param workfaceIds 需要删除的工作面信息主键
     * @return 结果
     */
    @Override
    public int deleteWorkfaceInfoByWorkfaceIds(Long[] workfaceIds)
    {
        return workfaceInfoMapper.deleteWorkfaceInfoByWorkfaceIds(workfaceIds);
    }

    /**
     * 删除工作面信息信息
     * 
     * @param workfaceId 工作面信息主键
     * @return 结果
     */
    @Override
    public int deleteWorkfaceInfoByWorkfaceId(Long workfaceId)
    {
        return workfaceInfoMapper.deleteWorkfaceInfoByWorkfaceId(workfaceId);
    }
}
